// 创建一个 workers
var worker = new Worker('./worker.js')
worker.postMessage('I am a worker')
worker.onmessage = function (e) {
  console.log(e.data)
  worker.terminate()
}